<include file="public:header" />
<div class="allpagetop">用户管理<strong>/</strong>列表</div>
<div class="admin_main_nr_dbox">
 	    <div class="pagetit">
	        <div class="ptit">用户</div>
				<div class="topnav">
			         
					  <a href="{:RU('user/lists',array('isadmin'=>''))}" <if condition="$Think.get.isadmin eq ''">class="select"</if>>全部</a>
					   
					  <a href="{:RU('user/lists',array('isadmin'=>0))}" <if condition="$Think.get.isadmin eq '0'">class="select"</if>>普通</a>
				 	  <a href="{:RU('user/lists',array('isadmin'=>1))}" <if condition="$Think.get.isadmin eq '1'">class="select"</if>>管理员</a>
					   
				    <div class="clear"></div>
				</div>
	        <div class="clear"></div>
	    </div>
		
  
    <form id="form1" name="form1" method="post" action="{:RU('user/allsave')}">

	  <div class="admin_list_th">
	    <div class="td1" style=" width:15%;"> 
		  <label id="chkAll" class="left_txt_td"><input type="checkbox" name="chkAll"  id="chk" title="全选/反选" />用户名</label>		 
		</div>
		<div class="td4" style=" width:10%;">头像</div>
		<div class="td4" style=" width:10%;">手机号</div>
		<div class="td4" style=" width:5%;">禁言</div>
		<div class="td4" style=" width:5%;">{:C('UU_GOLD_BYNAME')}</div>
		<div class="td4" style=" width:5%;">经验</div>
		<div class="td2" style=" width:5%;">采纳率</div>
		<div class="td2" style=" width:10%;">注册时间</div>
		<div class="td3" style=" width:10%;">最后登录</div>
		<div class="td2 admin_list_center" style=" width:10%;">问题/文章</div>
		<div class="td2 admin_list_center" style=" width:5%;">管理员</div>
		<div class="td5" style=" width:10%;">
		<div class="admin_list_right">操作</div>
		</div>
	  <div class="clear"></div>
	  </div>
	  
	  
	  
	  
	  
	    <volist name="lists.list" id="list">
					   <div class="admin_list_tr link_bk">
						<div class="td1" style=" width:15%;">
							  <div class="left_txt_td striking">
						 
									<input name="uid[]" type="checkbox" id="uid" value="{$list.uid}"  />
									<span class="userLV">LV{$list.exp_lv}</span>
									<a href="{$list.url}" target="_blank">{$list.username}</a>
							  </div>
						</div>
						<div class="td4" style=" width:10%;">
						 <img src="{$list.avatar}" border="0" align="absmiddle" style="width:32px; height:32px; border-radius:50%;">
						</div>
						<div class="td4 striking" style=" width:10%;">
						 {$list.mobile|default="未填写"}
						</div>
						<div class="td4" style=" width:5%;">
						<empty name="list.ban">
						否
						<else /> 
						<span style="color:#FF6600">是</span><span class="view vtip" title="禁言类型：{$list.ban.txt}<br>开始时间：{$list.ban.addtime_str}<br>结束时间：{$list.ban.endtime_str}">&nbsp;&nbsp;</span>
						</empty> 
						</div>
						<div class="td4" style=" width:5%;"><span class="admingold">{$list.gold}</span></div>
						<div class="td4" style=" width:5%;">{$list.exp}</div>
					 	<div class="td4" style=" width:5%;">{$list.acc_rate}%</div>
						<div class="td4" style=" width:10%;">{$list.reg_time_str}</div>
						<div class="td4" style=" width:10%;">{$list.last_login_time_str}</div>
						<div class="td4 admin_list_center" style=" width:10%;">{$list.count_question}/{$list.count_article}</div>
						<div class="td2 admin_list_center" style=" width:5%;">
						<if condition="$list.isadmin eq '1' "><span style="color:#FF0000">是</span>
						<else /> 否
						</if>
						</div>
						
						<div class="td5" style=" width:10%;">
									  <div class="admin_list_right link_blue">
									 <a href="{:RU('user/delete',array('uid'=>$list['uid']))}" onclick="return confirm('同时删除他的问答和文章等信息，你确定要删除吗？')">删除</a>
									  </div>
						</div>
					  <div class="clear"></div>
					  </div>
	   </volist>
	  
	
	  <div id="J_ban_from"></div>
	  <div id="J_isadmin_from"></div>
      </form> 

  
  
    <empty name="lists.list">
    <div class="admin_list_no_info">没有任何信息！</div>
    </empty>
	
	
	
	<div class="admin_list_foot">
			  <div class="btnbox">
			 	 <input type="button"  class="admin_submit"   value="禁言" id="J_btn_ban"/>
				 <input type="button"  class="admin_submit"   value="类型" id="J_isadmin_ban"/>
				 <input type="button"  class="admin_submit"   id="J_btn_del"  value="删除 "/>
			  </div>
			  
			   
	          <div class="footso">
			  			<form action="{:RU('user/lists')}" method="get">
						<div class="sobox">
							<input name="key" type="text"  class="sinput" maxlength="10" value="{$Think.get.key}"/>
							<input name="key_type" id="J_key_type_id" type="hidden" value="{$Think.get.key_type|default="1"}" />
							<input name="key_type_cn" id="J_key_type_cn" type="hidden" value="{$Think.get.key_type_cn|default="标题"}" />
							<input name="" type="submit" value=""  class="sobtn"/>
							<div class="sotype" id="J_key_click">{$Think.get.key_type_cn|default="用户名"}</div>
							
							
							
							
							
							<div class="mlist" id="J_mlist">
							<ul>
							<li id="1" title="用户名">用户名</li>
							<li id="2" title="UID">UID</li>
							<li id="3" title="手机号">手机号</li>
							</ul>
							</div>
						</div>
						</form>
			  </div>
			  
	          
	</div>
  <div class="uupage">{$lists.page}</div>
  
</div>
<include file="public:footer" />

 

<div id="J_ban_select" style="display:none">

  <div class="showdialog">
 				<div class="dtit">将所选用户禁言：</div>
				
				<div class="dtxt">
						<div class="imgradio">
							<input name="ban" type="hidden" value="1" />
							<input name="bantxt" type="hidden" value="禁言一天" />
							<div class="radio select" data="1" data1="禁言一天">禁言一天</div>
							 
							<div class="radio" data="3" data1="禁言三天">禁言三天</div>
							 
							<div class="radio" data="7" data1="禁言七天">禁言七天</div>
							 
							<div class="radio" data="30" data1="禁言一月">禁言一月</div>
							 
							<div class="radio" data="0" data1="永久禁言">永久禁言</div>
							 
							<div class="radio" data="-1" data1="解除禁言">解除禁言</div>
							<div class="clear"></div>
						</div>
				</div>
 
		
				   <div class="dtxt">
				   <input type="button"  class="admin_submit"   value="确定选择" id="J_save_ban_btn"/>
				   </div>
  </div>
	  
</div>



<div id="J_isadmin_select" style="display:none">

  <div class="showdialog">
 				<div class="dtit">将所选用户设置为：</div>
				
				<div class="dtxt">
						<div class="imgradio">
							<input name="isadmin" type="hidden" value="0" />
							<div class="radio select" data="0">普通用户</div>
							 <div class="clear"></div>
							<div class="radio"        data="1">管理员</div>
					
							<div class="clear"></div>
						</div>
				</div>
 
		
				   <div class="dtxt">
				   <input type="button"  class="admin_submit"   value="确定选择" id="J_save_isadmin_btn"/>
				   </div>
  </div>
	  
</div>


<script type="text/javascript">
    $(document).ready(function()
    {	
 
        //点击批量删除   
        $("#J_btn_del").click(function(){
			
            if (confirm('同时删除他的问答和文章等信息，你确定要删除吗？'))
            {
				$("form[name=form1]").attr("action","{:RU('user/delete')}").submit();
            }
        });
		//禁言用户
		$("#J_btn_ban").dialog({
		  DialogAddObj:"#J_ban_from",
		  DialogTitle:"禁言用户",
		  DialogContent:"#J_ban_select",
		  DialogContentType:"id"
		});
		//确定禁言
		$('#J_save_ban_btn').live('click',function() {
			$("form[name=form1]").attr("action","{:RU('user/ban')}").submit();
		});
		//设置用户类型
		$("#J_isadmin_ban").dialog({
		  DialogAddObj:"#J_isadmin_from",
		  DialogTitle:"设置用户",
		  DialogContent:"#J_isadmin_select",
		  DialogContentType:"id"
		});
		//确定用户类型
		$('#J_save_isadmin_btn').live('click',function() {
			$("form[name=form1]").attr("action","{:RU('user/isadmin')}").submit();
		});
		 
		
    });
</script>
</body>
</html>